home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.3 / Video Toaster v4.3.iso / 4.2 / arexx / editor / oz / 32-grp-link < prev    next >
Text File  |  1998-04-16  |  3KB  |  95 lines

  1. /* Grp_Link.rexx V1.3 -- links a set of audio clips together to start after the previous one ends */
  2.  
  3. /* by Aussie  ©1995 Michael Holten        
  4.  
  5. To use: find or place a number of AUDIO clips together in a row, highlight one of them and run this ARexx routine.  Every AUDIO clip will be timed to start immediately after the one before finishes.
  6.  
  7. Note: This routine starts at the highlighted clip and stops at the first NON AUDIO clip. (e.g. effect, stop, still, video etc.)            
  8.  
  9. */
  10.  
  11.  
  12. call remlib('PROJECT_REXX_PORT')
  13. call addlib('PROJECT_REXX_PORT',0)
  14.  
  15. /* --- begin --- */
  16. start_loc=croutonspot()
  17. call croutonpick(LAST)
  18. project_end=croutonsinproject()
  19. current_spot=start_loc
  20. isaudio=0
  21. did_one=0
  22.  
  23. /* --- Read current audio clip --- */
  24. call croutonpick(current_spot)
  25. current_spot=current_spot+1
  26.  
  27. /* --- test for audio clip --- */
  28. if croutontype()=" AUD" then isaudio=1
  29.  
  30. /* --- wait for any screen update delay --- */
  31. call time('R')
  32. do while (time('E')<0.5)
  33.     end
  34.  
  35. call req_open("Link - by Aussie","----------------","Links start times of SELECTED AUDIO clip to the","  following AUDIO clips.  (Stops at first non-audio clip)  ")
  36.  
  37. if isaudio=0 then do
  38.    call req_tell("Nope.  The selected clip..."," must be an AUDIO ONLY crouton!")
  39.    call req_close()
  40.    call quit
  41.    end
  42.  
  43. test = req_tell("Ok to Link these audio clips","     so they follow each other?")
  44. call req_close()
  45. if test=0 then call quit
  46.  
  47. prevstart=croutongettag(Delay)
  48. Last_Time_Mode= croutongettag(TimeMode)  /* Locking to 2=prog time  1=inpoint 0=clip */
  49. prevstart=prevstart+croutongettag(AudioDuration)
  50. isaudio=1
  51. current_temp=current_spot
  52.    
  53.  
  54. /* --- loop starts --- */
  55. do while isaudio=1
  56.    isaudio=0
  57.  
  58. /* --- set following audio clips start points --- */
  59.    call croutonpick(current_spot)
  60.    current_spot=current_spot+1
  61.    if croutontype()=" AUD" then isaudio=1
  62.    if isaudio=0 & did_one=0 then do
  63.       call req_tell("The following clip is NOT an audio crouton!")
  64.       call quit
  65.       end
  66.    if isaudio=0 then call quita
  67.  
  68.    did_one=1
  69.    call croutonsettag(Delay,PrevStart)
  70.    call croutonsettag(TimeMode,Last_Time_Mode)  /* Locking to 2=prog time  1=inpoint 0=clip */
  71.  
  72. /* --- Set up next link --- */
  73.    prevstart=croutongettag(Delay)
  74.    prevstart=prevstart+croutongettag(AudioDuration)
  75.    isaudio=1
  76.    current_temp=current_spot
  77.    if current_spot=project_end+1 then isaudio=0
  78.    end
  79.  
  80.  
  81. /* --- Wrap Up --- */
  82. quita:
  83. call projectupdate()
  84. call croutonpick(start_loc)
  85. call req_error(" OZ:   All Done   <<< Link is perfect >>>",)
  86. call remlib("PROJECT_REXX_PORT")
  87. exit
  88.  
  89. quit:
  90. call croutonpick(start_loc)
  91. call req_error(" OZ:    <<< Last Operation Canceled >>>")
  92. call remlib("PROJECT_REXX_PORT")
  93.  
  94. exit
  95.